import Vue from 'vue'
import Vuex from 'vuex'

import { createPersistedState, createSharedMutations } from 'vuex-electron'

import modules from './modules'

Vue.use(Vuex)

export default new Vuex.Store({
	state:{
		account:''
	},
	mutations: {
	    ADD_USER_DATA: (state, data) => {
	      state.account = data
	    }
	  },
  modules,
  plugins: [
    createPersistedState(),
    createSharedMutations()
  ],
  strict: process.env.NODE_ENV !== 'production',
  getters:{
	  getAccount(){
		  if(state.account){
			  state.account = localStorage.getItem('token')
		  }
		  return state.account
	  }
  },
  actions:{
	  
  }
})
